home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Full / NetObjects Fusion 9 Standard / NOF9_Full_EN.exe / data1.cab / FSI / lib / nof / ImageAttributes.js < prev    next >
Encoding:
Text File  |  2005-11-16  |  2.3 KB  |  87 lines

  1. /****i* SOURCE_FILE/INFO
  2.     *
  3.     * NAME
  4.     *  ImageAttributes.js
  5.     *
  6.     * USAGE
  7.     *  Part of Netobjects JavaScript Library.
  8.     *
  9.     * COPYRIGHT
  10.     *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.     *  All Rights Reserved.
  12.     *
  13.     *  This is an unpublished work protected by Website Pros, Inc.
  14.     *  as a trade secret, and is not to be used or disclosed except as
  15.     *  expressly provided in a written license agreement executed by
  16.     *  you and Website Pros, Inc.
  17.     *
  18.     *      <copyright@websitepros.com>
  19.     *
  20.     * NOTES
  21.     *  JavaScript code.
  22.     *
  23.     *****/
  24. if (!IS.isModuleInitialized("IS.NOF.ImageAttributes"))
  25. {
  26.     /****h* NOF_JavaScript_Library/NOF.ImageAttributes
  27.     *
  28.     * NAME
  29.     *  NOF.ImageAttributes
  30.     *
  31.     * DESCRIPTION
  32.     *  
  33.     *    External dependencies: none
  34.     ****/
  35.     
  36.     /**
  37.     * Constructor            
  38.     **/
  39.     function NOF_ImageAttributes() {
  40.         
  41.         this.__proto__ = NOF_ImageAttributes.prototype;
  42.         
  43.         this.flags               = arguments.length > 0 ? arguments[0] : 0;
  44.         this.width               = arguments.length > 1 ? arguments[1] : 0;
  45.         this.height              = arguments.length > 2 ? arguments[2] : 0;
  46.         this.quality             = arguments.length > 3 ? arguments[3] : 0;
  47.         this.format              = arguments.length > 4 ? arguments[4] : 'JPEG';       
  48.         this.alt                 = arguments.length > 5 ? arguments[5] : '';
  49.         this.isOriginalImage    = arguments.length > 6 ? arguments[6] : 0;
  50.         this.stretch            = arguments.length > 7 ? arguments[7] : 1;
  51.     }            
  52.     {
  53.         
  54.         var method = NOF_ImageAttributes.prototype;
  55.                     
  56.         method.equal     = function (o) {
  57.             return ( this.flags == o.flags 
  58.                 && this.width == o.width
  59.                 && this.height == o.height
  60.                 && this.quality == o.quality
  61.                 && this.format == o.format            
  62.                 && this.alt == o.alt 
  63.                 && this.isOriginalImage == o.isOriginalImage 
  64.                 && this.stretch == o.stretch );
  65.         }
  66.         
  67.         method.clone    = function () {
  68.             return new ImageAttributes(this.flags, this.width,
  69.                 this.height, this.quality, this.format, this.alt, this.isOriginalImage );
  70.         }
  71.         
  72.         method.toString = function () {
  73.             return '  flags = ' + this.flags + 
  74.                 ', width = ' + this.width + 
  75.                 ', height = ' + this.height + 
  76.                 ', quality = ' + this.quality + 
  77.                 ', format = ' + this.format +             
  78.                 ', alt = ' + this.alt +
  79.                 ', isOriginalImage = ' + this.isOriginalImage +
  80.                 ', stretch = ' + this.stretch;    
  81.         }    
  82.         
  83.     }
  84.     
  85.     NOF.__proto__.ImageAttributes = NOF_ImageAttributes;            
  86. }
  87.